package com.pig4cloud.pigx.admin.api.enums;

/**
 * @author lfx
 * @date 2020/9/25
 * 四乱整治状态枚举
 */
public enum GovernStatusEnum {

    UN_GOVERN("1", "未治理"),
    GOVERNING("2", "治理中"),
    GOVERNED("3", "已治理");

    private String type;
    private String name;

    GovernStatusEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    // 根据类型获取名称
    public static String getNameByType(String type) {
        for (GovernStatusEnum facilitiesTypeEnum : GovernStatusEnum.values()) {
            if (facilitiesTypeEnum.getType().equals(type)) {
                return facilitiesTypeEnum.getName();
            }
        }
        return null;
    }
}
